<template>
	<view>
		<view class="title">附近门店</view>
		<view class="lc-lise" v-for="(item,index) in shopList" >
			<view class="lc-shop-box">
				<image :src="imgDomain+item.logo" mode="aspectFill"></image>
				<view class="lc-shop-detail">
					<view class="lc-shop-name">{{item.title}}</view>
					<view class="lc-shop-foot">
						<view class="lc-shop-woo">
							<view class="lc-shop-star" style="display: none;margin-left: 0rpx;">{{item.mobile}}</view>
							<view class="lc-shop-num" style="margin-left: 0rpx;">
								<text style="background-color: blanchedalmond;padding: 5rpx 10rpx;margin-right: 4rpx;" v-for="(it,ind) in item.brand">{{it}}</text>
							</view>
						</view>
						<view class="lc-shop-km">{{item.distance}}km</view>
					</view>
					<view class="shop-address">{{item.address}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				app: getApp().globalData,
				imgDomain:'https://xcx.yumeishangmao.com/',
				baseurl: getApp().globalData.baseurl,
				shopList:[]
			}
		},
		mounted() {
			var that = this
			uni.getLocation({
				type: 'wgs84',
				success: (res) => {
					console.log(res)
					that.$api.sendRequest({
						url: '/api/site/shopList', 
						data: {lat: res.latitude,lng:res.longitude},
						success: res => {
							that.shopList = res.data
						}
					})
				},
				fail(res) {
					that.$api.sendRequest({
						url: '/api/site/shopList', 
						data: {lat: '45',lng:'123'},
						success: res => {
							that.shopList = res.data
						}
					})
				}
			})
		}
	}
</script>

<style lang="scss">
	.title{
		font-size:32rpx;color:#303133;font-weight:bold; margin-left: 3%; margin-bottom: 20rpx;
	}
	
	.lc-lise {
		width: 690rpx;
		margin-bottom: 30rpx;
		background-color: #FFFFFF;
		border-radius: 16rpx;
		padding: 30rpx 0;
		margin-left: 30rpx;
	
		.lc-shop-box {
			width: 690rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
	
			image {
				width: 108rpx;
				height: 108rpx;
				margin-left: 30rpx;
				border-radius: 16rpx;
			}
	
			.lc-shop-detail {
				width: 498rpx;
				margin-right: 30rpx;
	
				.lc-shop-name {
					font-size: 30rpx;
					color: #3D3D3D;
				}
	
				.lc-shop-foot {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-top: 10rpx;
	
					.lc-shop-woo {
						display: flex;
						align-items: center;
	
						.lc-shop-star {
							font-size: 24rpx;
							color: #FB4E2F;
						}
	
						.lc-shop-num {
							font-size: 24rpx;
							color: #999999;
							margin-left: 10rpx;
						}
					}
	
					.lc-shop-km {
						font-size: 24rpx;
						color: #999999;
					}
				}
	
				.shop-address {
					font-size: 26rpx;
					color: #999999;
					margin-top: 10rpx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}
		}
	
		.lc-shop-goods {
			width: 498rpx;
			margin-left: 162rpx;
			display: flex;
			justify-content: space-between;
			margin-top: 30rpx;
	
			.lc-shop-goods-list {
				width: 160rpx;
	
				image {
					width: 160rpx;
					height: 160rpx;
					border-radius: 16rpx;
				}
	
				.lc-goods-name {
					font-size: 24rpx;
					color: #3D3D3D;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
	
				.lc-goods-money {
					font-size: 30rpx;
					color: #FB4E2F;
					margin-top: 6rpx;
				}
			}
		}
	}
	
	
</style>